
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

using Traffic.Graphics;

namespace Traffic
{
    class SpriteDragControl : Control
    {

        protected Sprite _sprite;
        public Sprite Sprite
        {
            get { return _sprite; }
            set { _sprite = value; }
        }

        protected bool _dragging;
        public bool Dragging
        {
            get { return _dragging; }
            set { _dragging = value; }
        }

        public SpriteDragControl(Game game) : base(game) { }
       
        protected override void LoadGraphicsContent(bool loadAllContent)
        {
        }

        public override void Draw(GameTime gameTime)
        {         
        }

        public override void Update(GameTime gameTime)
        {
            if (MouseOver())
            {               
                if (previousState == ButtonState.Released && Mouse.GetState().LeftButton == ButtonState.Pressed)
                {
                    Activated = true;
                }
                previousState = Mouse.GetState().LeftButton;
            }
            else
            {                
            }

            base.Update(gameTime);
        }
    }
}
